package com.ruoyi.queue.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.queue.domain.QueWinBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.queue.mapper.QueWinMapper;
import com.ruoyi.queue.domain.QueWin;
import com.ruoyi.queue.service.IQueWinService;
import com.ruoyi.common.core.text.Convert;

/**
 * 排队窗口Service业务层处理
 *
 * @author Zliming
 * @date 2020-03-18
 */
@Service
public class QueWinServiceImpl implements IQueWinService {
    @Autowired
    private QueWinMapper queWinMapper;

    /**
     * 查询排队窗口
     *
     * @param id 排队窗口ID
     * @return 排队窗口
     */
    @Override
    public QueWin selectQueWinById(Long id) {
        return queWinMapper.selectQueWinById(id);
    }

    /**
     * 查询排队窗口列表
     *
     * @param queWin 排队窗口
     * @return 排队窗口
     */
    @Override
    public List<QueWin> selectQueWinList(QueWin queWin) {
        return queWinMapper.selectQueWinList(queWin);
    }

    /**
     * 查询排队窗口业务集合
     *
     * @param winID 排队窗口ID
     * @return 窗口业务集合
     */
    @Override
    public List<QueWinBiz> selectQueWinBizList(Long winID) {
        return queWinMapper.selectQueWinBizList(winID);
    }

    /**
     * 新增排队窗口
     *
     * @param queWin 排队窗口
     * @return 结果
     */
    @Override
    public int insertQueWin(QueWin queWin) {
        queWin.setCreateTime(DateUtils.getNowDate());
        return queWinMapper.insertQueWin(queWin);
    }

    /**
     * 修改排队窗口
     *
     * @param queWin 排队窗口
     * @return 结果
     */
    @Override
    public int updateQueWin(QueWin queWin) {
        queWin.setUpdateTime(DateUtils.getNowDate());
        return queWinMapper.updateQueWin(queWin);
    }

    /**
     * 删除排队窗口对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteQueWinByIds(String ids) {
        return queWinMapper.deleteQueWinByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除排队窗口信息
     *
     * @param id 排队窗口ID
     * @return 结果
     */
    @Override
    public int deleteQueWinById(Long id) {
        return queWinMapper.deleteQueWinById(id);
    }
}
